package cn.cheln.explorer.ds;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import cn.cheln.explorer.ds.database.CategoryInfo;
import cn.cheln.explorer.ds.database.SQLManager;

public class MediaArgs
{
  public static final String APK_EXT = "apk";
  public static final String APK_MIME = "application/vnd.shortcut.package-archive";
  public static Uri AudioUri;
  public static final String[] CATEGORYPROJECTION;
  public static final String COUNT = " count(distinct _data) ";
  public static final String CountProjection = " count(distinct _data) , sum(_size) ";
  public static final String FORMAT = " format ";
  public static final String ID = "_id";
  public static Uri ImageUri;
  public static final String[] LISTPROJECTION;
  public static final String MIMETYPE = "mime_type";
  public static final String MODIFIED = "date_modified";
  public static final String PACKAGE_MIME = "application/vnd.shortcut.package-archive";
  public static final String PATH = "_data";
  public static final String SIZE = "_size";
  public static final String SORT_KEY = "sort_key";
  public static final String SUMSIZE = " sum(_size) ";
  public static final String THEME_MIME = "lewa/theme";
  public static final String TITLE = "title";
  public static Uri VideoUri;
  public static Uri dirUri;
  public static Uri otherUri;

  static
  {
    Uri localUri = OtherFile.OtherFileColumns.CONTENT_URI;
    otherUri = localUri;
    AudioUri = localUri;
    VideoUri = localUri;
    ImageUri = OtherFile.OtherFileColumns.IMAGE_URI;
    dirUri = OtherFile.OtherFileColumns.DIR_URI;
    LISTPROJECTION = new String[] { "_data", "title", "_size", "date_modified" };
    CATEGORYPROJECTION = new String[] { " count(distinct _data) ", " sum(_size) " };
  }

  public static final String countWhereOnMimeLike(boolean paramBoolean)
  {
    StringBuilder localStringBuilder = new StringBuilder("mime_type ");
    if (paramBoolean);
    for (String str = ""; ; str = "not ")
      return str + "like ?";
  }

  public static final String getIsMimeNull(boolean paramBoolean)
  {
    if (paramBoolean)
      return "";
    return " or (mime_type is null )";
  }

  public static Cursor listQuery4NoMedia(Context paramContext, Uri paramUri, String[] paramArrayOfString, boolean paramBoolean, String paramString1, String paramString2)
  {
    String[] arrayOfString;
    ContentResolver localContentResolver = paramContext.getContentResolver();
    String str = whereOnMimeLike(paramBoolean);
    if (paramBoolean)
    {
      arrayOfString = new String[1];
      arrayOfString[0] = paramString1;
    }
    while (true)
    {
      return localContentResolver.query(paramUri, paramArrayOfString, str, arrayOfString, paramString2);
      arrayOfString = null;
    }
  }

  public static Cursor queryDocImage(Context paramContext, Uri paramUri, String[] paramArrayOfString, String paramString)
  {
    return listQuery4NoMedia(paramContext, paramUri, paramArrayOfString, false, "application/vnd.shortcut.package-archive", paramString.toString());
  }

  public static Cursor search(Context paramContext, Uri paramUri, CategoryInfo paramCategoryInfo, String paramString1, String paramString2)
  {
    boolean bool;
    Cursor localCursor;
    if ("apk".equals(paramCategoryInfo.categorySign))
    {
      ContentResolver localContentResolver6 = paramContext.getContentResolver();
      String[] arrayOfString6 = new String[1];
      arrayOfString6[0] = SQLManager.getSearchPart_Apk_Sql("", paramString2, new String[] { paramString1 }) + "--";
      localCursor = localContentResolver6.query(paramUri, arrayOfString6, null, null, null);
    }
    do
    {
      return localCursor;
      if ("doc".equals(paramCategoryInfo.categorySign))
      {
        ContentResolver localContentResolver5 = paramContext.getContentResolver();
        String[] arrayOfString5 = new String[1];
        arrayOfString5[0] = SQLManager.getSearchPart_Files_Sql("", paramString2, new String[] { paramString1 }) + "--";
        return localContentResolver5.query(paramUri, arrayOfString5, null, null, null);
      }
      if ("folder".equals(paramCategoryInfo.categorySign))
      {
        ContentResolver localContentResolver4 = paramContext.getContentResolver();
        String[] arrayOfString4 = new String[1];
        arrayOfString4[0] = SQLManager.getSearchPart_Folder_Sql("", paramString2, new String[] { paramString1 }) + "--";
        return localContentResolver4.query(paramUri, arrayOfString4, null, null, null);
      }
      if ("video".equals(paramCategoryInfo.categorySign))
      {
        ContentResolver localContentResolver3 = paramContext.getContentResolver();
        String[] arrayOfString3 = new String[1];
        arrayOfString3[0] = SQLManager.getSearchPart_Video_Sql("", paramString2, new String[] { paramString1 }) + "--";
        return localContentResolver3.query(paramUri, arrayOfString3, null, null, null);
      }
      if ("image".equals(paramCategoryInfo.categorySign))
      {
        ContentResolver localContentResolver2 = paramContext.getContentResolver();
        String[] arrayOfString2 = new String[1];
        arrayOfString2[0] = SQLManager.getSearchPart_Image_Sql("", paramString2, paramCategoryInfo.imageFilterSize, new String[] { paramString1 }) + "--";
        return localContentResolver2.query(paramUri, arrayOfString2, null, null, null);
      }
      bool = "audio".equals(paramCategoryInfo.categorySign);
      localCursor = null;
    }
    while (!(bool));
    ContentResolver localContentResolver1 = paramContext.getContentResolver();
    String[] arrayOfString1 = new String[1];
    arrayOfString1[0] = SQLManager.getSearchPart_Music_Sql("", paramString2, new String[] { paramString1 }) + "--";
    return localContentResolver1.query(paramUri, arrayOfString1, null, null, null);
  }

  public static final String whereOnMimeLike(boolean paramBoolean)
  {
    if (paramBoolean);
    for (String str = ""; ; str = "mime_type is not null and (mime_type not like 'application/vnd.shortcut.package-archive' and mime_type like 'application%' ) or mime_type like 'text%' and  format  <> 12289")
    {
      StringBuilder localStringBuilder = new StringBuilder(" ");
      if (paramBoolean)
        str = "mime_type like ?";
      return str;
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.ds.MediaArgs
 * JD-Core Version:    0.5.2
 */